package sbc.group1.lab1.mozartspaces;

import org.mozartspaces.core.ContainerReference;

import sbc.group1.lab1.common.Engine;


class EngineProducer extends AbstractProducer {
    private final Engine.Type type;
    
    public EngineProducer(int id, int partsToProduce, Space space, 
            double relaticeDefects, Engine.Type type) {
        super(id, partsToProduce, space, relaticeDefects);
        this.type=type;
    }

    @Override
    protected Engine createInstance() {
        return new Engine(this,type, randomIsDefect());
    }

    @Override
    protected ContainerReference getContainer() {
        return getSpace().getEngineContainer();
    }

}
